package com.base.cn.platform.os.service.manage.sysUser;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 用户单独授权接口
 *
 * @author s.li
 * @date 2019/02/14
 */
@FeignClient(name = BaseService.appName,configuration = FeignAuthConfig.class)
public interface SysUserFunctionService extends BaseService {

    /**
     * 获取所有的权限数据
     * @param userId 用户ID
     * @return 权限数据列表
     */
    @RequestMapping(contextPath + "/findAllFunction")
    List<Map<String,Object>> findAllFunction(@RequestParam("userId") BigDecimal userId);

    /**
     * 保存用户权限
     * @param userId 用户ID
     * @param functionIds　权限ID串
     * @retur Map<String,Object>
     */
    @RequestMapping(contextPath + "/saveUserFunction")
    Map<String,Object> saveUserFunction(@RequestParam("userId") BigDecimal userId,
                                        @RequestParam(value = "functionIds", required = false, defaultValue = "") String functionIds);
}
